import Vue from 'vue'
import App from './App'
import store from './store' 

Vue.prototype.$fetch = (type, url, data={}) => {	
	console.log(`fetch`)
	let option = {
		url,
		method: type,
		data
	}
	
	let promise = new Promise(function(resolve, reject) {
		uni.request(option)
		.then(res => {
			resolve(res[1])
		})
		.catch(err => {
			reject(err)
		})
	})
	
	return promise
}
Vue.prototype.$store = store

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App,
	store 
})
app.$mount()
